<?php

class Application_Model_logisticslogItem extends Application_Model_DomainObject {

    protected $_id; //序号
    protected $_logisticsNo; //物流单号
    protected $_opDate; //操作时间
    protected $_opRemark; //操作描述
    protected $_opState; //操作状态
    protected $_opUser; //操作者
    
    protected $_wayId;//运单ID

    /**
     * 根据物流单号获取相关信息
     */
    public static function getByNo($No) {
        return self::getDao()->queryAll(array("wayId"=>$No));
    }

    /**
     * 根据运单返回物流状态
     * @param int $wayId
     * @return array 
     */
    public static function getByWayId($wayId){
        $logs = Application_Model_logisticslogItem::getDao()->queryAll(array('wayId'=>$wayId));
        return array_reverse($logs);
    }
    
    /**
         * 删除物流信息
         * @param type $id
         */
        public static function dellic($id)
        {
            $where[' id = '] = $id;
            return Application_Model_logisticslogItem::getDao()->del($where);
        }
}